<template>
  <div class="bg">
    <div class="about">
      <div>
        <h2>关于:</h2>
        <span>这个应用可以用来追踪你选择城市的当前天气</span>
      </div>
      <div>
        <h2>如何使用:</h2>
        <p>1.点击搜索框输入你希望追踪的城市</p>
        <p>2.在搜索结果中选中一个城市，你将获取当地最新的天气</p>
        <p>3.点击右侧的＋号可以将追踪城市的天气情况保存在首页</p>
      </div>
      <div>
        <h2>移除城市:</h2>
        <span>如果你不想在首页关注某个城市,可以通过底部的按钮删除它</span>
      </div>
      <button @click="updateAbout">关闭</button>
    </div>
  </div>
</template>

<script setup>
import { useWeatherStore } from '@/stores/weather.js'
const store = useWeatherStore()
const { updateAbout } = store
</script>

<style lang="scss" scoped>
.bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  .about {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    // height: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
    padding: 20px;
    h2 {
      line-height: 20px;
    }
    span,
    p {
      font-size: 12px;
      line-height: 16px;
    }
    button {
      background: #00668a;
      width: 72px;
      height: 32px;
      border: none;
      color: #fff;
      text-align: center;
      margin-top: 20px;
    }
  }
}
</style>
